/*
 * Copyright (C) 2008-2011  Paulo Cesar Pereira de Andrade.
 *
 * This is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * Authors:
 *	Paulo Cesar Pereira de Andrade
 */

#ifndef _etag_h
#define _etag_h

#include "etypes.h"

/*
 * Types
 */
enum etagtype {
    tag_auto,
    tag_basic,
    tag_class,
    tag_vector,
    tag_function,
};

struct etag {
    etag_t		*next;
    eobject_t		 data;
    eobject_t		 name;
    eword_t		 key;
    etagtype_t		 type;
    etag_t		*base;
    eword_t		 size;
};

/*
 * Prototypes
 */
extern void
init_tag(void);

extern void
finish_tag(void);

extern etag_t *
etag_object(eobject_t object);

extern etag_t *
etag_vector(etag_t *base, eword_t length);

etag_t *
etag_vector_alias(etag_t *tag);

extern etag_t *
etag_prototype(etag_t *base, east_t *decl);

extern etag_t *
etag_ast(etag_t *base, east_t **list);

extern etag_t *
etag_ast_data(etag_t *tag, east_t *ast);

/*
 * Externs
 */
extern etag_t		*auto_tag;
extern etag_t		*string_tag;

#endif /* _etag_h */
